<template>
    <div style="padding: 0px 20px">
      <div style="display: flex; justify-content: space-between">
        <div style="font-size: 19px">
          <span>患者监护级别：</span><span class="red">{{ level }}</span>
        </div>
  
        <div>
          <el-button
            @click="openFirst"
            style="background-color: #f9d9dd; color: #000"
            >一级药学监护</el-button
          >
          <el-button
            @click="openSecond"
            style="background-color: #fef0df; color: #000"
            >二级药学监护</el-button
          >
        </div>
      </div>
  
      <h2 style="margin-top: 5px">药学监护分级表</h2>
      <template>
        <h3>1、一级药学监护分级标准</h3>
        <h4>具备以下情况之一的患者，可以确定并实施一级药学监护。</h4>
        <div
          style="margin: 7px 0px"
          :class="
            form.isRenalFunction == 1 ||
            form.bloodDialysis == 1 ||
            form.hemofiltration == 1 ||
            form.bloodReplacement == 1 ||
            form.bloodPerfusion == 1 ||
            form.extracorporeal == 1
              ? 'red'
              : ''
          "
        >
          （1）<span> 严重肾功能不全（Clcr≤30ml/min）</span
          >或接受<span>血液透析</span>、<span>血液过滤</span>、
          <span>血浆置换</span
          >、<span>血液灌流</span>、<span>体外膜肺氧合</span>等治疗的患者；
        </div>
        <div
          style="margin: 7px 0px"
          :class="
            form.isAlt == 1 ||
            form.isAst == 1 ||
            form.isAlp == 1 ||
            form.isTbil == 1 ||
            form.ctpValue > 10 ||
            form.extracorporeal == 1
              ? 'red'
              : ''
          "
        >
          （2）
          <span>严重肝功能不全</span>（生化指标<span>ALT</span>
          或
          <span>AST＞5ULN</span> or<span>ALP＞5ULN</span>
          or
          <span>T-BiL＞3ULN）</span>或
          <span> 肝功能 CTP （Child-Turcotte-Pugh）评分≥10 分</span>者；
        </div>
        <div style="margin: 7px 0px" :class="form.bothValue == 1 ? 'red' : ''">
          （3）
          <span
            >同时伴有中度肾功能不全（30ml/min＜Clcr≤60ml/min）和中度肝功能不全（生化指标ALT或
            AST＞2~4ULN orALP＞2~4ULN orT-BiL＞2~3ULN ，或CTP 评分＞7~9
            分者）</span
          >；
        </div>
        <div style="margin: 7px 0px" :class="form.showShock == 1 ? 'red' : ''">
          （4）<span>出现休克的患者</span>；
        </div>
        <div
          style="margin: 7px 0px"
          :class="form.arteryBloodCheck == 1 ? 'red' : ''"
        >
          （5）<span
            >动脉血气检查分析结果氧分压＜60mmHg，二氧化碳分压＞50mmHg 的患者</span
          >；
        </div>
        <div style="margin: 7px 0px" :class="form.ntProBnp == 1 ? 'red' : ''">
          （6）<span
            >50 岁以下患者血浆 NT-proBNP＞450ng/L 或 50 岁以上患者血浆
            NT-proBNP＞900ng/L 或 75 岁以上患者 NT-proBNP＞1800ng/L
            或肾功能不全（肾小球滤过率＜60mL/min）血浆 NT-proBNP＞1200ng/L</span
          >；
        </div>
        <div style="margin: 7px 0px" :class="form.ctNt == 1 ? 'red' : ''">
          （7）
          <span>外周血 cTnT> 0.5 μg/L</span>
          ；
        </div>
        <div
          style="margin: 7px 0px"
          :class="form.bloodClotting == 1 ? 'red' : ''"
        >
          （8）<span
            >凝血酶原时间>18 s 或活化部分凝血活酶时间>60 s 或凝血酶时间>15 s
            或血浆凝血酶原时间比率>1.6</span
          >
          ；
        </div>
        <div style="margin: 7px 0px" :class="form.pillsCount == 1 ? 'red' : ''">
          （9）
          <span>用药超过 15 种的患者；</span>
        </div>
        <div style="margin: 7px 0px">
          <div>（10）应用治疗指数狭窄的药物；</div>
          <div class="pl50 mt3" style="line-height: 21px">
            如：氨茶碱、卡马西平、盐酸克林霉素、盐酸可乐定、二羟丙茶碱、磷酸丙吡胺、炔雌醇、
            硫酸胍乙啶、甲磺酸乙基异丙肾上腺素、硫酸异丙肾上腺素、碳酸锂、硫酸奥西那林、米诺地尔、羟色胺、苯妥英钠、盐酸哌唑嗪、普里米酮、盐酸普鲁卡因胺、硫酸奎尼丁、葡萄糖酸奎尼丁、茶碱、丙戊酸、双丙戊酸钠、华法林、环孢素、他克莫司；
          </div>
        </div>
        <div
          style="margin: 7px 0px"
          :class="form.unionAntineoplastic == 1 ? 'red' : ''"
        >
          （11）
          <span>联合应用≥3 种抗肿瘤药物</span>；
        </div>
        <div
          style="margin: 7px 0px"
          :class="form.thrombolyticTherapy == 1 ? 'red' : ''"
        >
          （12）
          <span>3 日内接受溶栓治疗患者</span>；
        </div>
        <div style="margin: 7px 0px" :class="form.adrAde == 1 ? 'red' : ''">
          （13）
          <span>
            血药浓度监测值异常或出现严重 ADR/ADE 的患者（严重 ADR/ADE
            的定义按照国家药品不良反应监测
            中心印发的《药品不良反应报告和监测工作手册》）
          </span>
          ；
        </div>
        <div
          style="margin: 7px 0px"
          :class="form.isSpecialAntibiosis == 1 ? 'red' : ''"
        >
          （14）
          <span>使用特殊使用级抗菌药物</span>
          ；
        </div>
        <div
          style="margin: 7px 0px"
          :class="form.extremelyPoisonousDrugs == 1 ? 'red' : ''"
        >
          （15）
          <span>使用大毒中药饮片患者</span>
          ；
        </div>
        <div
          style="margin: 7px 0px"
          :class="form.ishighWarningPills == 1 ? 'red' : ''"
        >
          （16）
          <span>
            使用 A
            级高警示药品患者（参照中国药学会发布的《高警示药品管理的专用标识和分级管理策略》）
          </span>
          ；
        </div>
        <div
          style="margin: 7px 0px"
          :class="form.isCareLevelValue == 1 ? 'red' : ''"
        >
          （17）
          <span>护理级别为特级护理患者</span>
          ；
        </div>
        <div
          style="margin: 7px 0px"
          :class="form.twoChronicDisease == 1 ? 'red' : ''"
        >
          （18）
          <span
            >同时患有两种以上国家医保或各省、市、自治区医保目录报销的慢病。</span
          >
        </div>
      </template>
      <template>
        <h3>2、二级药学监护分级标准</h3>
        <h4>具备以下情况之一的患者，可以确定并实施二级药学监护。</h4>
        <div style="margin: 7px 0px">
          （1）<span :class="form2.isModerateRenalFunction == 1 ? 'red' : ''"
            >中度肾功能不全（30ml/min＜Clcr≤60ml/min）</span
          >；
        </div>
        <div style="margin: 7px 0px">
          （2）中度肝功能不全（<span :class="form2.isAltValue == 1 ? 'red' : ''"
            >生化指标 ALT</span
          >
          <span :class="form2.isAstValue == 1 ? 'red' : ''"> 或 AST＞2~4ULN</span>
          or
          <span :class="form2.isAlpValue == 1 ? 'red' : ''"> ALP＞2~4ULN </span>or
          <span :class="form2.isTbil == 1 ? 'red' : ''">T-BiL＞2~3ULN）</span>或
          <span :class="form2.ctpValue == 1 ? 'red' : ''">
            CTP 评分＞ 7~9 分者</span
          >
          ；
        </div>
        <div style="margin: 7px 0px">
          （3）<span :class="form2.isChild == 1 ? 'red' : ''"
            >非儿科的患儿（＜14 岁） </span
          >、高龄（＞75 岁）及非产科、生殖医学科妊娠期患者；
        </div>
        <div style="margin: 7px 0px">
          （4）<span :class="form2.isHistoryAllergy == 1 ? 'red' : ''"
            >有既往药物过敏史；</span
          >
        </div>
        <div style="margin: 7px 0px">
          （5）<span :class="form2.isSimultaneously == 1 ? 'red' : ''"
            >同时应用药物超过 10 种或同时使用 2 种有明确相互作用药物的患者</span
          >
          ；
        </div>
        <div style="margin: 7px 0px">
          （6）<span :class="form2.isVenousAntisepsis == 1 ? 'red' : ''"
            >静脉使用氨基苷类抗菌药物的患者</span
          >
          ；
        </div>
        <div style="margin: 7px 0px">
          （7）<span :class="form2.isBadAntisepsis == 1 ? 'red' : ''"
            >存在抗菌药物不良反应高危因素者（凝血功能异常、中枢神经系统损伤）</span
          >
          ；
        </div>
        <div style="margin: 7px 0px">
          （8）
          <span :class="form2.unionThreeAntisepsis == 1 ? 'red' : ''">
            联合使用 3 种以上抗菌药物</span
          >；
        </div>
        <div style="margin: 7px 0px">
          （9）
          <span :class="form2.isHighWarningPills == 1 ? 'red' : ''">
            使用
            B级高警示药品（参照中国药学会发布的《高警示药品管理的专用标识和分级管理策略》）的患者
          </span>
          ；
        </div>
        <div style="margin: 7px 0px">
          （10）
          <span :class="form2.extremelyPoisonousDrugs == 1 ? 'red' : ''">
            使用有毒中药饮片的患者
          </span>
          ；
        </div>
        <div style="margin: 7px 0px">
          （11）
          <span :class="form2.isVenousTransfusion == 1 ? 'red' : ''">
            接受静脉输液泵入给药、经胃食管给药患者
          </span>
          ；
        </div>
        <div style="margin: 7px 0px">
          （12）
          <span :class="form2.isCareLevelValue == 1 ? 'red' : ''">
            护理级别为一级护理患者
          </span>
          ；
        </div>
        <div style="margin: 7px 0px">
          （13）
          <span :class="form2.oneChronicDisease == 1 ? 'red' : ''">
            患有一种国家医保或各省、市、自治区医保目录报销的慢病
          </span>
          。
        </div>
      </template>
  
      <h3>3、三级药学监护分级标准 除一、二级以外均为三级</h3>
  
      <!-- 一级药学监护对话框 -->
      <el-dialog
        :title="title"
        :visible.sync="open"
        width="1300px"
        append-to-body
      >
        <div class="r" style="justify-content: space-between">
          <div style="width: 1080px">
            (1) 严重肾功能不全（Clcr≤30ml/min）或接受血液透析、血液过滤、
            血浆置换、血液灌流、体外膜肺氧合等治疗的患者
          </div>
          <div>
            <el-radio-group v-model="form.bloodDialysis">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </div>
        </div>
        <div class="r  mt15" style="justify-content: space-between">
          <div style="width: 1080px">
            (2) 严重肝功能不全（生化指标ALT 或 AST＞5ULN orALP＞5ULN or
            T-BiL＞3ULN）或 肝功能 CTP （Child-Turcotte-Pugh）评分≥10 分者
          </div>
          <div>
            <el-radio-group v-model="form.bloodDialysis">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </div>
        </div>
        <div class="r  mt15" style="justify-content: space-between">
          <div style="width: 1080px">
            (3)
            同时伴有中度肾功能不全（30ml/min＜Clcr≤60ml/min）和中度肝功能不全（生化指标ALT或
            AST＞2~4ULN orALP＞2~4ULN orT-BiL＞2~3ULN ，或CTP 评分＞7~9 分者）
          </div>
          <div>
            <el-radio-group v-model="form.bloodDialysis">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </div>
        </div>
        <div class="r  mt15" style="justify-content: space-between">
          <div style="width: 1080px">(4) 出现休克的患者</div>
          <div>
            <el-radio-group v-model="form.bloodDialysis">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </div>
        </div>
        <div class="r  mt15" style="justify-content: space-between">
          <div style="width: 1080px">
            (5) 动脉血气检查分析结果氧分压＜60mmHg，二氧化碳分压＞50mmHg 的患者
          </div>
          <div>
            <el-radio-group v-model="form.bloodDialysis">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </div>
        </div>
        <div class="r  mt15" style="justify-content: space-between">
          <div style="width: 1080px">
            (6) 50 岁以下患者血浆 NT-proBNP＞450ng/L 或 50 岁以上患者血浆 NT-proBNP＞900ng/L 或 75 岁以上患者 NT-proBNP＞1800ng/L 或肾功能不全（肾小球滤过率＜60mL/min）血浆 NT-proBNP＞1200ng/L
          </div>
          <div>
            <el-radio-group v-model="form.bloodDialysis">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </div>
        </div>
        <div class="r  mt15" style="justify-content: space-between">
          <div style="width: 1080px">
            (7) 外周血 cTnT> 0.5 μg/L
          </div>
          <div>
            <el-radio-group v-model="form.bloodDialysis">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </div>
        </div>
        <div class="r  mt15" style="justify-content: space-between">
          <div style="width: 1080px">
            (8) 凝血酶原时间>18 s 或活化部分凝血活酶时间>60 s 或凝血酶时间>15 s 或血浆凝血酶原时间比率>1.6 
          </div>
          <div>
            <el-radio-group v-model="form.bloodDialysis">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </div>
        </div>
        <div class="r  mt15" style="justify-content: space-between">
          <div style="width: 1080px">
            (9) 用药超过 15 种的患者
          </div>
          <div>
            <el-radio-group v-model="form.bloodDialysis">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </div>
        </div>
        <div class="r  mt15" style="justify-content: space-between">
          <div style="width: 1080px">
            (10) 应用治疗指数狭窄的药物
          </div>
          <div>
            <el-radio-group v-model="form.bloodDialysis">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </div>
        </div>
        <div class="r  mt15" style="justify-content: space-between">
          <div style="width: 1080px">
            (11)  联合应用≥3 种抗肿瘤药物
          </div>
          <div>
            <el-radio-group v-model="form.bloodDialysis">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </div>
        </div>
        <div class="r  mt15" style="justify-content: space-between">
          <div style="width: 1080px">
            (12) 3 日内接受溶栓治疗患者
          </div>
          <div>
            <el-radio-group v-model="form.bloodDialysis">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </div>
        </div>
        <div class="r  mt15" style="justify-content: space-between">
          <div style="width: 1080px">
            (13)  血药浓度监测值异常或出现严重 ADR/ADE 的患者（严重 ADR/ADE 的定义按照国家药品不良反应监测 中心印发的《药品不良反应报告和监测工作手册》）
          </div>
          <div>
            <el-radio-group v-model="form.bloodDialysis">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </div>
        </div>
        <div class="r  mt15" style="justify-content: space-between">
          <div style="width: 1080px">
            (14) 使用特殊使用级抗菌药物
          </div>
          <div>
            <el-radio-group v-model="form.bloodDialysis">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </div>
        </div>
        <div class="r  mt15" style="justify-content: space-between">
          <div style="width: 1080px">
            (15) 使用大毒中药饮片患者 
          </div>
          <div>
            <el-radio-group v-model="form.bloodDialysis">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </div>
        </div>
        <div class="r  mt15" style="justify-content: space-between">
          <div style="width: 1080px">
            (16)  使用 A 级高警示药品患者（参照中国药学会发布的《高警示药品管理的专用标识和分级管理策略》）
          </div>
          <div>
            <el-radio-group v-model="form.bloodDialysis">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </div>
        </div>
        <div class="r  mt15" style="justify-content: space-between">
          <div style="width: 1080px">
            (17) 护理级别为特级护理患者
          </div>
          <div>
            <el-radio-group v-model="form.bloodDialysis">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </div>
        </div>
        <div class="r  mt15" style="justify-content: space-between">
          <div style="width: 1080px">
            (18) 同时患有两种以上国家医保或各省、市、自治区医保目录报销的慢病
          </div>
          <div>
            <el-radio-group v-model="form.bloodDialysis">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </div>
        </div>
        <el-form
          ref="form"
          :model="form"
          label-width=""
          label-position="right"
          v-if="false"
        >
          <el-form-item
            label="严重肾功能不全（Clcr≤30ml/min）或接受血液透析、血液过滤、 血浆置换、血液灌流、体外膜肺氧合等治疗的患者"
          >
            <el-radio-group v-model="form.bloodDialysis">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </el-form-item>
  
          <el-form-item
            label="严重肝功能不全（生化指标ALT 或 AST＞5ULN orALP＞5ULN or T-BiL＞3ULN）或 肝功能 CTP （Child-Turcotte-Pugh）评分≥10 分者"
          >
            <el-radio-group v-model="form.hemofiltration">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </el-form-item>
  
          <el-form-item
            label="同时伴有中度肾功能不全（30ml/min＜Clcr≤60ml/min）和中度肝功能不全（生化指标ALT或 AST＞2~4ULN orALP＞2~4ULN orT-BiL＞2~3ULN ，或CTP 评分＞7~9 分者）"
          >
            <el-radio-group v-model="form.bloodReplacement">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </el-form-item>
  
          <el-form-item label="出现休克的患者">
            <el-radio-group v-model="form.bloodPerfusion">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </el-form-item>
  
          <el-form-item
            label="动脉血气检查分析结果氧分压＜60mmHg，二氧化碳分压＞50mmHg 的患者"
          >
            <el-radio-group v-model="form.extracorporeal">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </el-form-item>
  
          <el-form-item
            label="50 岁以下患者血浆 NT-proBNP＞450ng/L 或 50 岁以上患者血浆 NT-proBNP＞900ng/L 或 75 岁以上患者 NT-proBNP＞1800ng/L 或肾功能不全（肾小球滤过率＜60mL/min）血浆 NT-proBNP＞1200ng/L:"
          >
            <el-radio-group v-model="form.ctpValue">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </el-form-item>
  
          <el-form-item label="外周血 cTnT> 0.5 μg/L">
            <el-radio-group v-model="form.showShock">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </el-form-item>
  
          <el-form-item label="动脉血气检查分析：">
            <el-radio-group v-model="form.arteryBloodCheck">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </el-form-item>
  
          <el-form-item label="血浆NT-proBNP：">
            <el-radio-group v-model="form.ntProBnp">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </el-form-item>
  
          <el-form-item label="外周血 cTnT：">
            <el-radio-group v-model="form.ctNt">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </el-form-item>
  
          <el-form-item label="凝血酶原时间cTnT：">
            <el-radio-group v-model="form.bloodClotting">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </el-form-item>
  
          <el-form-item label="用药超过15种：">
            <el-radio-group v-model="form.pillsCount">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </el-form-item>
  
          <el-form-item label="联合应用≥3种抗肿瘤药物：">
            <el-radio-group v-model="form.unionAntineoplastic">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </el-form-item>
  
          <el-form-item label="3 日内接受溶栓治疗：">
            <el-radio-group v-model="form.thrombolyticTherapy">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </el-form-item>
  
          <el-form-item label="血药浓度监测值异常或出现严重 ADR/ADE 的患者：">
            <el-radio-group v-model="form.adrAde">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </el-form-item>
  
          <el-form-item label="使用大毒中药饮片：">
            <el-radio-group v-model="form.extremelyPoisonousDrugs">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </el-form-item>
  
          <el-form-item label="患有两种以上医保目录报销的慢性病：">
            <el-radio-group v-model="form.twoChronicDisease">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </el-form-item>
          <!-- <el-col :span="12">
              <el-form-item label="同时伴有中度肾功能不全和中度肝功能不全：">
                <el-radio-group v-model="form.bothValue">
                  <el-radio label="1">是</el-radio>
                  <el-radio label="0">否</el-radio>
                </el-radio-group>
              </el-form-item>
            </el-col> -->
        </el-form>
        <div slot="footer" class="dialog-footer">
          <el-button :loading="buttonLoading" type="primary" @click="submitForm"
            >确 定</el-button
          >
          <el-button @click="cancel">取 消</el-button>
        </div>
      </el-dialog>
  
      <!-- 二级药学监护对话框 -->
      <el-dialog
        :title="title2"
        :visible.sync="open2"
        width="900px"
        append-to-body
      >
      <div class="r" style="justify-content: space-between">
          <div style="width:730px">
            (1) 中度肾功能不全（30ml/min＜Clcr≤60ml/min）
          </div>
          <div>
            <el-radio-group v-model="form.bloodDialysis">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </div>
        </div>
        <div class="r  mt15" style="justify-content: space-between">
          <div style="width:730px">
            (2) 中度肝功能不全（生化指标 ALT 或 AST＞2~4ULN or ALP＞2~4ULN or T-BiL＞2~3ULN）或 CTP 评分＞ 7~9 分者 
          </div>
          <div>
            <el-radio-group v-model="form.bloodDialysis">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </div>
        </div>
        <div class="r  mt15" style="justify-content: space-between">
          <div style="width:730px">
            (3) 非儿科的患儿（＜14 岁） 、高龄（＞75 岁）及非产科、生殖医学科妊娠期患者
          </div>
          <div>
            <el-radio-group v-model="form.bloodDialysis">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </div>
        </div>
        <div class="r  mt15" style="justify-content: space-between">
          <div style="width:730px">(4) 有既往药物过敏史</div>
          <div>
            <el-radio-group v-model="form.bloodDialysis">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </div>
        </div>
        <div class="r  mt15" style="justify-content: space-between">
          <div style="width:730px">
            (5) 同时应用药物超过 10 种或同时使用 2 种有明确相互作用药物的患者 
          </div>
          <div>
            <el-radio-group v-model="form.bloodDialysis">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </div>
        </div>
        <div class="r  mt15" style="justify-content: space-between">
          <div style="width:730px">
            (6) 静脉使用氨基苷类抗菌药物的患者 
          </div>
          <div>
            <el-radio-group v-model="form.bloodDialysis">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </div>
        </div>
        <div class="r  mt15" style="justify-content: space-between">
          <div style="width:730px">
            (7) 存在抗菌药物不良反应高危因素者（凝血功能异常、中枢神经系统损伤）
          </div>
          <div>
            <el-radio-group v-model="form.bloodDialysis">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </div>
        </div>
        <div class="r  mt15" style="justify-content: space-between">
          <div style="width:730px">
            (8) 联合使用 3 种以上抗菌药物
          </div>
          <div>
            <el-radio-group v-model="form.bloodDialysis">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </div>
        </div>
        <div class="r  mt15" style="justify-content: space-between">
          <div style="width:730px">
            (9) 使用B级高警示药品（参照中国药学会发布的《高警示药品管理的专用标识和分级管理策略》）的患者
          </div>
          <div>
            <el-radio-group v-model="form.bloodDialysis">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </div>
        </div>
        <div class="r  mt15" style="justify-content: space-between">
          <div style="width:730px">
            (10) 使用有毒中药饮片的患者
          </div>
          <div>
            <el-radio-group v-model="form.bloodDialysis">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </div>
        </div>
        <div class="r  mt15" style="justify-content: space-between">
          <div style="width:730px">
            (11) 接受静脉输液泵入给药、经胃食管给药患者
          </div>
          <div>
            <el-radio-group v-model="form.bloodDialysis">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </div>
        </div>
        <div class="r  mt15" style="justify-content: space-between">
          <div style="width:730px">
            (12) 护理级别为一级护理患者 
          </div>
          <div>
            <el-radio-group v-model="form.bloodDialysis">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </div>
        </div>
        <div class="r  mt15" style="justify-content: space-between">
          <div style="width:730px">
            (13) 患有一种国家医保或各省、市、自治区医保目录报销的慢病
          </div>
          <div>
            <el-radio-group v-model="form.bloodDialysis">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </div>
        </div>
        <el-form
          v-if="false"
          ref="form2"
          :model="form2"
          label-width="250px"
          label-position="left"
        >
          <el-form-item label="肝功能 CTP评分≥10 分：">
            <el-radio-group v-model="form2.ctpValue">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </el-form-item>
  
          <el-form-item label="非儿科的患者：">
            <el-radio-group v-model="form2.isChild">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </el-form-item>
  
          <el-form-item label="有既往药物过敏史：">
            <el-radio-group v-model="form2.isHistoryAllergy">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </el-form-item>
  
          <el-form-item label="同时应用药物超过10种或2种有明确相互作用：">
            <el-radio-group v-model="form2.isSimultaneously">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </el-form-item>
  
          <el-form-item label="静脉使用氨基苷类抗菌药物：">
            <el-radio-group v-model="form2.isVenousAntisepsis">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </el-form-item>
  
          <el-form-item label="存在抗菌药物不良反应:">
            <el-radio-group v-model="form2.isBadAntisepsis">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </el-form-item>
  
          <el-form-item label="联合使用3种以上抗菌药物：">
            <el-radio-group v-model="form2.unionThreeAntisepsis">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </el-form-item>
  
          <el-form-item label="使用有毒中药饮片：">
            <el-radio-group v-model="form2.extremelyPoisonousDrugs">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </el-form-item>
  
          <el-form-item label="接受静脉输液泵入给药：">
            <el-radio-group v-model="form2.isVenousTransfusion">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </el-form-item>
  
          <el-form-item label="患有一种以上医保目录报销的慢性病：">
            <el-radio-group v-model="form2.oneChronicDisease">
              <el-radio label="1">是</el-radio>
              <el-radio label="0">否</el-radio>
            </el-radio-group>
          </el-form-item>
  
          <!-- 
              <el-form-item label="使用 B 级高警示药品值：">
                <el-radio-group v-model="form2.isHighWarningPills">
                  <el-radio label="1">是</el-radio>
                  <el-radio label="0">否</el-radio>
                </el-radio-group>
              </el-form-item>
             -->
        </el-form>
        <div slot="footer" class="dialog-footer">
          <el-button :loading="buttonLoading2" type="primary" @click="submitForm2"
            >确 定</el-button
          >
          <el-button @click="cancel2">取 消</el-button>
        </div>
      </el-dialog>
    </div>
  </template>
  
  <script>
  import {
    firstLevel,
    firstLevelPost,
    twoLevel,
    twoLevelPost,
    red,
    guardianLevel,
  } from "@/api/workstation/baseInfo.js";
  export default {
    data() {
      return {
        // 弹出层标题
        title: "",
        // 是否显示弹出层
        open: false,
        // 表单参数
        form: {
          // bothValue: "",
          isRenalFunction: "",
          bloodDialysis: "",
          hemofiltration: "",
          bloodReplacement: "",
          bloodPerfusion: "",
          extracorporeal: "",
          isAlt: "",
          isAst: "",
          isAlp: "",
          isTbil: "",
          ctpValue: "",
          renalFunction: "",
          altValue: "",
          astValue: "",
          alpValue: "",
          tbil: "",
          showShock: "",
          arteryBloodCheck: "",
          ntProBnp: "",
          ctNt: "",
          bloodClotting: "",
          pillsCount: "",
          unionAntineoplastic: "",
          thrombolyticTherapy: "",
          adrAde: "",
          isSpecialAntibiosis: "",
          extremelyPoisonousDrugs: "",
          ishighWarningPills: "",
          isCareLevelValue: "",
          twoChronicDisease: "",
        },
        form2: {
          isModerateRenalFunction: "",
          isAltValue: "",
          isAstValue: "",
          isAlpValue: "",
          isTbil: "",
          ctpValue: "",
          isChild: "",
          isHistoryAllergy: "",
          isSimultaneously: "",
          isVenousAntisepsis: "",
          isBadAntisepsis: "",
          unionThreeAntisepsis: "",
          isHighWarningPills: "",
          extremelyPoisonousDrugs: "",
          isVenousTransfusion: "",
          isCareLevelValue: "",
          oneChronicDisease: "",
        },
        // 弹出层标题
        title2: "",
        // 是否显示弹出层
        open2: false,
        buttonLoading2: false,
        // 表单校验
        rules: {},
        // 按钮loading
        buttonLoading: false,
        medicalRecordNo: "", // 路由传过来的药历号
        level: "", // 患者监护级别
      };
    },
    created() {
      this.medicalRecordNo = this.$route.query.medicalRecordNo + "";
      this.getguardianLevel();
    },
    methods: {
      getguardianLevel() {
        guardianLevel(this.medicalRecordNo).then((res) => {
          if (res.data == 0) {
            this.level = "一级";
            return;
          }
          if (res.data == 1) {
            this.level = "二级";
            return;
          }
          if (res.data == 2) {
            this.level = "三级";
            return;
          }
        });
      },
      /** 查询用药咨询列表 */
      getList() {
        red(this.medicalRecordNo).then((res) => {
          console.log("[ res.data ] >", res.data);
          if (res.data.firstLevelVo !== null) {
            this.form = res.data.firstLevelVo;
          } else if (res.data.twoLevelVo !== null) {
            this.form2 = res.data.twoLevelVo;
          }
        });
      },
      openFirst() {
        firstLevel(this.medicalRecordNo).then((response) => {
          if (response.data !== null) {
            this.form = response.data;
            // this.$set(this.form, response.data);
          }
        });
        this.title = "一级药学监护";
        this.open = true;
      },
      // 取消按钮
      cancel() {
        this.getList();
        this.open = false;
        // this.reset();
      },
      // 表单重置
      reset() {
        this.form = {
          medicalRecordNo: this.medicalRecordNo,
          bloodDialysis: "0",
          hemofiltration: "0",
          bloodReplacement: "0",
          extracorporeal: "0",
          bloodPerfusion: "0",
          ctpValue: "0",
          showShock: "0",
          arteryBloodCheck: "0",
          ntProBnp: "0",
          ctNt: "0",
          bloodClotting: "0",
          pillsCount: "0",
          unionAntineoplastic: "0",
          thrombolyticTherapy: "0",
          adrAde: "0",
          extremelyPoisonousDrugs: "0",
          twoChronicDisease: "0",
        };
        this.resetForm("form");
      },
      /** 提交按钮 */
      submitForm() {
        this.$refs["form"].validate((valid) => {
          if (valid) {
            this.buttonLoading = true;
            this.form.medicalRecordNo = this.medicalRecordNo;
            // if (this.form.id != null) {
            firstLevelPost(this.form)
              .then((response) => {
                this.$modal.msgSuccess("修改成功");
                this.open = false;
                this.getList();
                this.getguardianLevel();
                // firstLevel(this.medicalRecordNo).then((response) => {
                //   if (response.data !== null) {
                //     // this.form = response.data;
                //     this.$set(this.form, response.data);
                //   }
                // });
              })
              .finally(() => {
                this.buttonLoading = false;
              });
            // } else {
            //   firstLevelPost(this.form)
            //     .then((response) => {
            //       this.$modal.msgSuccess("新增成功");
            //       this.open = false;
            //       firstLevel(this.medicalRecordNo).then((response) => {
            //         if (response.data !== null) {
            //           // this.form = response.data;
            //           this.$set(this.form, response.data);
            //         }
            //       });
            //     })
            //     .finally(() => {
            //       this.buttonLoading = false;
            //     });
            // }
          }
        });
      },
      openSecond() {
        twoLevel(this.medicalRecordNo).then((response) => {
          if (response.data !== null) {
            this.form2 = response.data;
            // this.$set(this.form2, response.data);
          }
        });
        this.title2 = "二级药学监护";
        this.open2 = true;
      },
      // 取消按钮
      cancel2() {
        this.getList();
        this.open2 = false;
        // this.reset2();
      },
      // 表单重置
      reset2() {
        this.form2 = {
          medicalRecordNo: this.medicalRecordNo,
          bloodDialysis: "0",
          hemofiltration: "0",
          bloodReplacement: "0",
          extracorporeal: "0",
          bloodPerfusion: "0",
          ctpValue: "0",
          showShock: "0",
          arteryBloodCheck: "0",
          ntProBnp: "0",
          ctNt: "0",
          bloodClotting: "0",
          pillsCount: "0",
          unionAntineoplastic: "0",
          thrombolyticTherapy: "0",
          adrAde: "0",
          extremelyPoisonousDrugs: "0",
          twoChronicDisease: "0",
        };
        this.resetForm("form2");
      },
      /** 提交按钮 */
      submitForm2() {
        this.$refs["form2"].validate((valid) => {
          if (valid) {
            this.buttonLoading2 = true;
            this.form2.medicalRecordNo = this.medicalRecordNo;
            // if (this.form2.id != null) {
            twoLevelPost(this.form2)
              .then((response) => {
                this.$modal.msgSuccess("修改成功");
                this.getList();
                this.getguardianLevel();
                // twoLevel(this.medicalRecordNo).then((response) => {
                //   if (response.data !== null) {
                //     // this.form2 = response.data;
                //     this.$set(this.form2, response.data);
                //   }
                // });
                this.open2 = false;
              })
              .finally(() => {
                this.buttonLoading2 = false;
              });
            // } else {
            //   twoLevelPost(this.form2)
            //     .then((response) => {
            //       this.$modal.msgSuccess("新增成功");
            //       this.open2 = false;
            //       twoLevel(this.medicalRecordNo).then((response) => {
            //         if (response.data !== null) {
            //           // this.form2 = response.data;
            //           this.$set(this.form2, response.data);
            //         }
            //       });
            //     })
            //     .finally(() => {
            //       this.buttonLoading2 = false;
            //     });
            // }
          }
        });
      },
    },
  };
  </script>
  
  <style lang="scss" scoped>
  .red {
    color: red;
  }
  
  .el-form-item {
    margin-bottom: 5px;
  }
  </style>
  